﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Spark.FileSystem;

namespace NBusiness.Templates.Engines.Spark
{
    class NBusinessViewFolder : IViewFolder
    {
        Dictionary<string, NBusinessViewFile> _templates = new Dictionary<string, NBusinessViewFile>();

        public void Add(string name, string template)
        {
            _templates.Add(name, new NBusinessViewFile(template));
        }

        #region IViewFolder Members

        public IViewFile GetViewSource(string path)
        {
            return _templates[path];
        }

        public bool HasView(string path)
        {
            return _templates.ContainsKey(path);
        }

        public IList<string> ListViews(string path)
        {
            return _templates.Keys.ToList();
        }

        #endregion
    }
}
